package com.xmmj.baselibrary.base.activity.mvvm

import androidx.lifecycle.*
import com.xmmj.baselibrary.base.event.BaseEvent

interface IBaseViewModel : LifecycleObserver {
    @OnLifecycleEvent(Lifecycle.Event.ON_ANY)
    fun onAny(var1: LifecycleOwner?, var2: Lifecycle.Event?)

    @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
    fun onCreate()

    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    fun onDestroy()

    @OnLifecycleEvent(Lifecycle.Event.ON_START)
    fun onStart()

    @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
    fun onStop()

    @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
    fun onResume()

    @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
    fun onPause()

    fun postEvent(event: BaseEvent)

    fun postStickyEvent(event: BaseEvent)

    fun postReLoadEvent()

    fun registerEventBus()

    fun unregisterEventBus()

    fun <T : BaseEvent> subscribe(event: T)

    fun <T : BaseEvent> subscribeBySticky(event: T)
}